package com.wzy.pojo;


import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.format.annotation.DateTimeFormat;

import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.Date;


@Data
@TableName(value = "articles")
public class Article {
    @TableId(type=IdType.AUTO)
    private Integer articleId;//id是数据自增的
    private String title;//文章标题
    private String content;//文章内容
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @TableField("created_at")
    private Date createdAt;//创建时间
    @TableField("updated_at")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date updatedAt;//更新时间
    private String author;//作者
    private String category;//种类
    private String tags;//标签
    private String description;//文章的描述信息 出现在首页面下
    private String imagePath;

    @Override
    public String toString() {
        return "Article{" +
                "article_id=" + articleId +
                ", title='" + title + '\'' +
                ", content='" + content + '\'' +
                ", createdAt=" + createdAt +
                ", updatedAt=" + updatedAt +
                ", author='" + author + '\'' +
                ", category='" + category + '\'' +
                ", tags='" + tags + '\'' +
                ", description='" + description + '\'' +
                ", image_path='" + imagePath + '\'' +
                '}';
    }
}

